<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>任务管理</title>
	<style type="text/css">
	body {
      padding: 30px;
    }
    #hd {
      height: 30px;
      background: yellowgreen;
      width: 0;
      text-align: center;
      font-weight: bold;
    }
    </style>
</head>
<body>
	<div id="hd"></div>
	<!-- <script src="index.js"></script> -->
	<script type="text/javascript">
 
 	function view () {
 		let i = 1 ;
 		(function handle(){
			console.log('i = ', i)
			 hd.innerHTML = i + "%";
      		hd.style.width = i + "%";
			if(i++ >= 100) {
				console.log('done... , i = ', i)
			} else {
 				setTimeout(handle, 20)
			}
 		})()

 	}

 	view()
	
	</script>
</body>
</html>